﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using SXFramWork.Core;
using SXFramWork.Model;
using SXFramWork.Service;

namespace SXFramWork.API.Controllers.Admin
{
    /// <summary>
    /// 系统配置
    /// </summary>
    public class SysConfigController : WebController
    {
        private ISysConfigService _service;
        public SysConfigController(ISysConfigService sysConfigService)
        {
            _service = sysConfigService;
        }
        /// <summary>
        /// 设置
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Menu("系统配置")]
        public async Task<IApiResult> Add([FromForm] ConfigAddModel model)
        {
            return await _service.Add(model);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Common]
        public async Task<IApiResult> Query()
        {
            return await _service.Query();
        }
    }
}